import axios from "axios";

import store from "../store/index"

// 全局的配置
axios.defaults.baseURL="http://localhost:3000";

axios.interceptors.request.use(function(config){

    store.commit("mChangeIsLoading",true);

    console.log("请求拦截器");

    return config;

},function(){
    console.log("出错");
});


axios.interceptors.response.use(function(res){
    console.log("响应拦截器");

    store.commit("mChangeIsLoading",false);

    return res;
},function(){
    console.log("出错");
})


export default axios;